<div ng-controller="NewSinisterCtrl">
	<div class="panel panel-primary text-center">
		<div class="panel-heading">
			<span class="main-title"><span class="glyphicon glyphicon-plus"></span> {{'sinisterDeclaration' | translate}}</span>
		</div>
	</div>
	<div message-error-panel ng-model="message" auto-close="false"></div>
	<div policy-header ng-model="sinister.policy" config="config.policy"></div>
	<div reinsurance-header ng-model="sinister.reinsuranceInfo" ng-if="config.reinsurance.show"></div>
	<div ng-show="message.code == $root.CODE_SUCCESS && sinister.policy.insureds.length > 0" class="panel panel-info">
		<div class="panel-heading">{{'availableInsureds' | translate}}</div>
		<div class="panel-body">
			<div class="list-group">
				<a class="list-group-item" ng-click="setSelectedInsured(insured)" ng-class="{'active' : sinister.policy.insured.idCardNumber == insured.idCardNumber}"
					ng-repeat="insured in sinister.policy.insureds">
					<div>
						<h4 class="list-group-item-heading">
							<label>{{insured.name}} {{insured.surname}}</label>
						</h4>
						<p class="left-20 list-group-item-text">
							<em>{{'Person.birthday' | translate}} : {{insured.birthday | date : 'dd/MM/yyyy'}} - {{'Person.idCardNumber' | translate}} : {{insured.idCardNumber}}</em>
						</p>
					</div>
				</a>
			</div>
		</div>
	</div>
	<div ng-show="message.code == $root.CODE_SUCCESS" class="panel panel-info">
		<div class="panel-heading">{{'availableWarranties' | translate}}</div>
		<div class="panel-body">
			<div class="list-group" ng-show="sinister.policy.warranties.length > 0">
				<a class="list-group-item" ng-click="setSelectedWarranty(warranty)" ng-class="{'active' : sinister.warranty.warrantyType.id == warranty.warrantyType.id}"
					ng-repeat="warranty in sinister.policy.warranties">
					<div>
						<h4 class="list-group-item-heading">
							<label>{{warranty.warrantyType.description | translate}}</label>
						</h4>
						<p class="left-20 list-group-item-text">
							<em>{{'Warranty.expirationDate' | translate}} : {{warranty.expirationDate | date : 'dd/MM/yyyy'}} - {{'Warranty.renovationDate' | translate}} : {{warranty.renovationDate | date : 'dd/MM/yyyy'}}</em>
						</p>
					</div>
				</a>
			</div>
			<div ng-show="sinister.policy.warranties.length == 0" translate="noAvailableWarranties"></div>
		</div>
	</div>
	<div ng-show="message.code == $root.CODE_SUCCESS" class="center">
		<button class="btn btn-primary" ng-click="prepare()" ng-disabled="sinister.warranty == null || (sinister.policy.insureds.length > 0 && sinister.policy.insured == null)">{{'accept' | translate}}</button>
	</div>
	<div ng-show="message.code != $root.CODE_SUCCESS" class="center">
		<div back-button></div>
	</div>
</div>